#ifndef HANDLERMAP_H
#define HANDLERMAP_H

#include <QObject>
#include <QGraphicsEllipseItem>
#include <QGraphicsLineItem>
#include <stdio.h>
#include "Aria.h"
#include "ArNetworking.h"
#include "mygoalitem.h"

class handlerMap : public QObject
{
    Q_OBJECT
public:
    explicit handlerMap(QObject *parent = 0,ArClientBase *client=0);
    
signals:
    void signal_paint_ellipse(QGraphicsEllipseItem *);
    void signal_paint_line(QGraphicsLineItem *);
    void signal_remove_ellipse(QGraphicsEllipseItem *);
    void signal_remove_line(QGraphicsLineItem *);
    void signal_paint_goal(myGoalItem *);
    void signal_remove_goal(myGoalItem *);
    void signal_paint_rect(QGraphicsRectItem *);
    void signal_remove_rect(QGraphicsRectItem *);
    
public slots:
    

private:
    ArClientBase *handledClient;


    std::vector <QGraphicsLineItem *> maplines;
    std::vector <QGraphicsEllipseItem *> mappoints;
    std::vector <myGoalItem *> mapgoals;
    std::vector <QGraphicsLineItem *> mapfline;
    std::vector <QGraphicsRectItem *> mapfrect;



    ArFunctor1C<handlerMap,ArNetPacket *> handleGetMapCB;
    ArFunctor1C<handlerMap,ArNetPacket *> handleGetMapNameCB;

    ArMap arMap;


    void handleGetMap(ArNetPacket *packet);
    void handleGetMapName(ArNetPacket *packet);


    bool getHeader;
    bool getTail;

   std::list< ArMapObject *> * listOfMapObjects;


};

#endif // HANDLERMAP_H
